<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
 <head>
      <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width,initial-scale=1.0">
       <title>机械师注册</title>
       
       <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
       <link rel="stylesheet" href="../../static/css/me.css">
  </head>
 <style>
   .m-container-small {
         max-width: 60em !important;
      height: 600px;
         /*margin: auto !important;*/
     }
   .m-padded-tb-massive {
           padding-top: 5em !important;
           padding-bottom: 5em !important;
   }
 </style>
 <body >
<br><br><br>
<div class="m-container-small m-padded-tb-massive" style="max-width: 30em !important;margin: 0px 0px 0px 1400px;float: left">
     <div class="ui container">
          <div class="ui middle aligned center aligned grid">

               <div class="column" style="margin-top: -70px;float: left">
                   <div style="display: none" class="ui negative message" th:unless="${#strings.isEmpty(message)}">
                     <i class="close icon"></i>
                       <div class="header">
                           校验失败
                      </div>
                      <p th:text="${message}"></p>
                  </div>
                  <h2 class="ui teal image header">
                       <div style="color: orangered" class="content">
                         注册
                       </div>
                  </h2>
                   <form class="ui large form" method="post"  th:action="@{/enroll}">
                      <div class="ui segment" >
                         <div class="field">
                              <div class="ui left icon input">
                                   <i class="user icon"></i>
                                <input  style="height: 60px;font-size: 27px" type="text" id="username" name="username" placeholder="账号"
                                            36                                    th:each="h: ${zh}"    th:value="${h}">
                           </div>
                         </div>
                          <div class="field">
                              <div class="ui left icon input">
                                  <i class="lock icon"></i>
                                  <input style="height: 60px;font-size: 27px" type="password" name="password" placeholder="密码">
                              </div>
                       </div>
                       <div class="field">
                             <div class="ui left icon input">
                                  <i class="mail icon"></i>
                                  <input type="text" name="email" id="email" placeholder="邮箱">
                                  <input type="button" id="getcode" class="ui grey label" value="获取验证码">
                             </div>

                          </div>
                          <div class="code field"  style="display:none" >


                          </div> <input type="text" name="identify" id="identify" placeholder="验证码">

                          <button style="background-color: orangered;margin-top: 20px;float: left" class="ui fluid large teal submit button" id="register-btn" >注 册</button>
                      </div>
                       <div id="isRepeat"></div>
                      <div class="ui error mini message"></div>

                   </form>


               </div>

         </div>

      </div>
  </div>
<div style="float: left;width: 100%;height: 600px;background-image: url(img/banner3.jpg) ;background-repeat: no-repeat;margin: -600px 0px 0px 0px">

</div>

 <script src="https://code.jquery.com/jquery-3.1.1.min.js" crossorigin="anonymous"></script>
 <script type="text/javascript" src="../../static/js/jquery.cookie.js" ></script>
 <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
<script>
  $('#getcode').click(function(){
      var st=$("#email").val();
      var stu={"username":st};
      $.ajax({

          url:'/zcaen1',
          type:'post',
          method:"post",
          contentType:'application/json',
          data:JSON.stringify(stu),
          success:function (data) {
              alert(data.data)
              // window.location.href= "http://localhost:9090/zhanhao12";


          }
      });


             });
</script>
 <script>
   $(function (){
     $.ajax({
       //url路径
       url: "http://localhost:9090/tourist/sendEmail",
       //data请求数据
       data: {"email": email},
       //dataType json
       type: "post",
       //回调函数
       success: function (data) {
         //回调函数 data 返回流
         if (data == "failure") {
           alert("发送失败");
         }
         else if (data=="false"){
           alert("目标邮箱不存在，请检查你的邮箱是否正确");
         }
         //  else{

         // }
       }
     });
   })
 </script>
 </body>
 </html>